home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / rtextu10.zip / WC.DOC < prev    next >
Text File  |  1993-05-06  |  5KB  |  123 lines

  1.  
  2.  
  3.                                 #     #  ##### 
  4.                                 #  #  # #     #
  5.                                 #  #  # #      
  6.                                 #  #  # #      
  7.                                 #  #  # #      
  8.                                 #  #  # #     #
  9.                                  ## ##   ##### 
  10.  
  11.  
  12.  
  13.  
  14. You can get part of the following documentation by invoking the program with
  15. the switches -v, -h, or -H . See README.TXT for more information.
  16.  
  17. -----------------------------------   -v   ------------------------------------
  18. WC v1.0 -- Count words, lines, and characters in several text files
  19. Copr (c) 1992,1993 Richard Breuer. WC is freeware. No warranties.
  20.  
  21. This is WC/2 v1.0 - renamed to WC (from RUTILS 4).
  22.  
  23. Author: Richard Breuer
  24.         Brunssumstrasse 6
  25.         5100 Aachen
  26.         (after Jul 1, 1993: 52074 Aachen)
  27.         Germany
  28.         Europe
  29.  
  30. Phone:  +49/241/85605
  31. Fax:    +49/241/8021329
  32.  
  33. Email:  ricki@pool.informatik.rwth-aachen.de (Preferred!)
  34.  
  35. -----------------------------------   -h   ------------------------------------
  36. WC v1.0 -- Count words, lines, and characters in several text files
  37. Copr (c) 1992,1993 Richard Breuer. WC is freeware. No warranties.
  38.  
  39. Usage:
  40.    WC [-clhHmnuvwx*] infile.. [{>|>>} outfile]
  41.  
  42. Options (+ are default):
  43. +  -c  Count characters - omitting NEWLINE characters!
  44. +  -l  Count lines
  45.    -h  Display this help screen
  46.    -H  Display another help screen with notes and examples
  47.    -m  Compute the length of the longest line
  48.    -n  Use "normal" character set: words are built only from letters and digits
  49. +  -u  Operate like Unix's wc: a word is a string of characters delimited by
  50.        SPACE, TAB, or NEWLINE characters
  51.    -v  Display version info and information about the author
  52. +  -w  Count words
  53.    -x  Use extended character set: "_" and "$" are treated as valid word
  54.        characters. Thus integer_var is counted as one, not two words. Gives
  55.        eg. more reliable results for Pascal source code
  56.    -*  Display internal information (for debugging purposes)
  57.  
  58. -----------------------------------   -H   ------------------------------------
  59. WC v1.0 -- Count words, lines, and characters in several text files
  60. Copr (c) 1992,1993 Richard Breuer. WC is freeware. No warranties.
  61.  
  62. Notes:
  63.    WC reads from stdin if a filename is -. The output is always directed
  64.    to stdout. The line lengths are restricted to 255 characters. Longer lines
  65.    will be cut. The errorlevel is set to 1 if help has been displayed. It is
  66.    set to 255 in case of an error and 0 on normal completion. Output resulting
  67.    from multiple input files is appended to stdout. The processing order for
  68.    wildcards depends on the order of the directory entries. WC returns
  69.    nonsense for binary files. If WC is called without options, a word
  70.    matches the regular expression [^ \t\n][^ \t\n]*.
  71.  
  72. Examples:
  73.    WC *.TXT
  74.       Process all *.TXT files in the current directory. The processing order
  75.       is the one DOS's dir tells you.
  76.    WC HEADER.TXT - FOOTER.TXT
  77.       After processing HEADER.TXT the user must input text from the keyboard
  78.       until Ctrl/Z (=EOF) is detected. Then FOOTER.TXT is processed. All output
  79.       is appended on stdout.
  80.    WC -l C:\TXT\
  81.       Count the lines of all files in the directory C:\TXT.
  82.  
  83. -------------------------------------------------------------------------------
  84. Additional information:
  85.    WC is similar to the Unix command with the same name. The main difference
  86.    is the way WC counts characters. The Unix version, as most DOS versions,
  87.    simply sets the character count to the length of the file in bytes. This is
  88.    not sufficient in my opinion. My WC counts everything but the CR/LF bytes
  89.    at the end of each line, which represents the REAL characters in the text
  90.    file. Therefore my WC will likely compute a character count which is some
  91.    amount smaller than the count other WC's compute.
  92.  
  93.    The following example illustrates the difference between the way WC counts
  94.    words for the three switches -u, -x, and -n. Consider a file DUMMY.DAT which
  95.    contains one single line
  96.  
  97.                 HELLO,WORLD_NET
  98.  
  99.    C:> WC -u DUMMY.DAT
  100.        1       1      15  DUMMY.DAT
  101.  
  102.        -u switches to Unix mode which means that words are delimited by SPACEs
  103.        and TABs only. Therefore "HELLO,WORLD_NET" is one word. -u is the
  104.        default mode.
  105.  
  106.    C:> WC -x DUMMY.DAT
  107.        1       2      15  DUMMY.DAT
  108.  
  109.        -x switches to the 'extended' character set, which means that _ and $
  110.        are supposed to be contained in words, whereas all other characters
  111.        which are not letters or digits, are taken as delimiters. Therefore
  112.        "HELLO,WORLD_NET" are two words: "HELLO" and "WORLD_NET", delimited by
  113.        the comma.
  114.  
  115.    C:> WC -n DUMMY.DAT
  116.        1       3      15  DUMMY.DAT
  117.  
  118.        -n switches to the 'normal' character set, which means that _ and $
  119.        are taken as delimiters, as well as any other character which is not a
  120.        letter or a digit. Therefore "HELLO,WORLD_NET" are now three words:
  121.        "HELLO", "WORLD", and "NET", delimited by the comma and the "_".
  122.  
  123.